package dfs;

public class Demo4 {
    public ListNode swapPairs(ListNode head) {
        if(head==null||head.next==null)return head;
        ListNode t1=swapPairs(head.next.next);
        ListNode ret=head.next;
        ret.next=head;
        head.next=t1;
        return ret;
    }
}
